﻿using System;

using CommandLine;

class Program
{
    public class Options
    {
        [Option('t', "type", Required = true, HelpText = "要输出的代码类型;\n\tCSharp:cs。")]
        public string Type { get; set; }
        [Option('i', "input", Required = true, HelpText = "输入要生成的协议文件。")]
        public string Input { get; set; }
        [Option('o', "output", Required = true, HelpText = "要输出的目录或文件路径。")]
        public string Output { get; set; }
        [Option('m', "monofile", Required = false, HelpText = "是否输出为单文件，默认输出多文件。")]
        public bool Monofile { get; set; }
    }
    static void Main(string[] args)
    {
        Parser.Default.ParseArguments<Options>(args).WithParsed(Run);
    }
    static void Run(Options options)
    {
        ZProto.Generator.Generate(options.Type, options.Input, options.Output, options.Monofile);
    }
}

